import { configureStore } from "@reduxjs/toolkit";

import loginSlice from "@/pages/login/loginSlice";

const store = configureStore({
  // 汇总所有reducers函数
  reducer: {
    login: loginSlice,
  },
});

// 文档：https://www.redux.org.cn/tutorials/typescript.html
export type RootState = ReturnType<typeof store.getState>; // redux管理所有数据的类型

export type AppDispatch = typeof store.dispatch; // dispatch函数类型

export default store;
